Move fatal and warning to a file of their own.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 17 Oct 2005 18:09:06 +0000 (18:09 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 17 Oct 2005 18:09:06 +0000 (18:09 +0000)
gpsbabel/Makefile
gpsbabel/fatal.c [new file with mode: 0644]
gpsbabel/util.c

index 6c5f13879040b8972895ab873dd10f884e1fbbd9..d42cf534a346d437255d7efb4ab84f2afd09933a 100644 (file)
@@ -59,7 +59,7 @@ SHAPE=shapelib/shpopen.o shapelib/dbfopen.o
 
 LIBOBJS = queue.o route.o waypt.o filter_vecs.o util.o vecs.o mkshort.o \
           csv_util.o strptime.o grtcirc.o vmem.o util_crc.o xmlgeneric.o \
-          uuid.o formspec.o xmltag.o cet.o cet_util.o \
+          uuid.o formspec.o xmltag.o cet.o cet_util.o fatal.o \
        $(COLDSYNC) $(GARMIN) $(JEEPS) $(SHAPE) $(FMTS) $(FILTERS)
 OBJS = main.o globals.o $(LIBOBJS)
 
diff --git a/gpsbabel/fatal.c b/gpsbabel/fatal.c
new file mode 100644 (file)
index 0000000..30275f4
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+    Functions to indicate inconsistent or fatal conditions.
+
+    Copyright (C) 2002-2005 Robert Lipe, robertlipe@usa.net
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
+
+ */
+
+#include "defs.h"
+void
+fatal(const char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+       vfprintf(stderr, fmt, ap);
+       va_end(ap);
+       exit(1);
+}
+
+void
+warning(const char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+       vfprintf(stderr, fmt, ap);
+       va_end(ap);
+}
+
index 4dd1da8eab690ce0a2e4723928781637f9c36662..fa0438584c7f8274f92fa62e948966ac48dbda45 100644 (file)
@@ -1,7 +1,7 @@
 /*
     Misc utilities.
 
-    Copyright (C) 2002 Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002-2005 Robert Lipe, robertlipe@usa.net
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -369,16 +369,6 @@ printposn(const double c, int is_lat)
        printf("%f%c ", fabs(c), d);
 }
 
-void
-fatal(const char *fmt, ...)
-{
-       va_list ap;
-       va_start(ap, fmt);
-       vfprintf(stderr, fmt, ap);
-       va_end(ap);
-       exit(1);
-}
-
 void
 is_fatal(const int condition, const char *fmt, ...)
 {
@@ -394,15 +384,6 @@ is_fatal(const int condition, const char *fmt, ...)
        fatal("%s\n", buff);
 }
 
-void
-warning(const char *fmt, ...)
-{
-       va_list ap;
-       va_start(ap, fmt);
-       vfprintf(stderr, fmt, ap);
-       va_end(ap);
-}
-
 /*
  * Read 4 bytes in big-endian.   Return as "int" in native endianness.
  */